﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Microsoft.Practices.EnterpriseLibrary.PolicyInjection;

using NCS.IConnect.ApplicationContexts;

using JM.JCY.BusinessFacade;
using JM.JCY.Common;
using JM.JCY.BusinessEntity;

namespace JM.JCY.Proxy
{
  public class NewsfeedProxy:JCYProxyBase<INewsfeed>,INewsfeed
    {
      private INewsfeed GetInstance()
      {
          return PolicyInjection.Create<NewsfeedBF, INewsfeed>();
      }

      public NewsfeedDataSet.T_FeedPostDataTable GetFeedPost(string appType, int appId, string excludePostId)
      {
          return this.GetInstance().GetFeedPost(appType, appId, excludePostId);
      }

      public NewsfeedDataSet.T_FeedPostDataTable GetMoreFeedPost(string appType, int appId, string excludePostId)
      {
          return this.GetInstance().GetMoreFeedPost(appType, appId, excludePostId);
      }

      public void InsertFeedPost(NewsfeedDataSet ds)
      {
          this.GetInstance().InsertFeedPost(ds);
      }

      public NewsfeedDataSet.T_FeedPostDataTable GetFeedPostEntity(int feedPostId)
      {
          return this.GetInstance().GetFeedPostEntity(feedPostId);
      }

      public NewsfeedDataSet.T_FeedPostDataTable GetFeedPostByObjectId(int objId)
      {
          return this.GetInstance().GetFeedPostByObjectId(objId);
      }

      public NewsfeedDataSet.T_FeedCommentDataTable InsertComment(NewsfeedDataSet ds)
      {
          return this.GetInstance().InsertComment(ds);
      }

      public NewsfeedDataSet.T_FeedCommentDataTable GetFeedCommentByNewsfeedId(int newsfeedId)
      {
          return this.GetInstance().GetFeedCommentByNewsfeedId(newsfeedId);
      }

      public NewsfeedDataSet.T_FeedCommentDataTable GetFeedCommentEntity(int commentId)
      {
          return this.GetInstance().GetFeedCommentEntity(commentId);
      }

      public NewsfeedDataSet.T_FeedCommentDataTable GetMoreCommentsByObj(int objId, int dataNum)
      {
          return this.GetInstance().GetMoreCommentsByObj(objId, dataNum);
      }

      public bool DeletePostCommentById(int commentId)
      {
          return this.GetInstance().DeletePostCommentById(commentId);
      }

      public DateTime GetFeedPostLastestUpdateTime(int feedPostId)
      {
          return this.GetInstance().GetFeedPostLastestUpdateTime(feedPostId);
      }

      public NewsfeedDataSet.T_FeedCommentDataTable GetPostCommentByPostId(int feedpostId, int dataNum)
      {
          return this.GetInstance().GetPostCommentByPostId(feedpostId, dataNum);
      }

      public void DeleteFeedPost(int feedpostId)
      {
          this.GetInstance().DeleteFeedPost(feedpostId);
      }

      public DateTime GetLatestFeedPostUpdateTime(string appType, int appId)
      {
          return this.GetInstance().GetLatestFeedPostUpdateTime(appType, appId);
      }

      public NewsfeedDataSet.T_UserInfoDataTable GetUserInfoEntity(int userId)
      {
          return this.GetInstance().GetUserInfoEntity(userId);
      }
    }
}
